package lu.med.praxiswahl.wahlumed.client.kalender;

import java.awt.BorderLayout;
import javax.swing.JDialog;
import javax.swing.JScrollPane;

import lu.med.praxiswahl.wahlumed.client.utilities.UniCode;

@SuppressWarnings("serial")
public class AlleTermineDialog extends JDialog
{
    public AlleTermineDialog(lu.med.praxiswahl.wahlumed.client.wclient.Main owner, String matricule, String von,
	    String bis)
    {
	super(owner, "Alle Termine f" + UniCode.getue() + "r : " + matricule,
		true);
	this.setLayout(new BorderLayout());
	JScrollPane jsp = new JScrollPane(new AlleTermineTable(
		new AlleTermineTableModel(matricule, von, bis)));
	this.add(jsp, BorderLayout.CENTER);
	this.pack();
	this.setLocation(150, 400);
	this.setSize(1100, 300);
	this.setVisible(true);
    }
    
    public AlleTermineDialog(lu.med.praxiswahl.wahlumed.client.wclient.Main owner, String matricule)
    {
	super(owner,true);
	this.setLayout(new BorderLayout());
	
	AlleTermineTableModel model = new AlleTermineTableModel(matricule);
	AlleTermineTable table = new AlleTermineTable(model);
	
	/*
	 * liefert die Anzahl an gefundene Termineintraege
	 */
	int anzahlEintraege = model.getRowCount();
	/*
	JScrollPane jsp = new JScrollPane(new AlleTermineTable(
		new AlleTermineTableModel(matricule))); */
	
	JScrollPane jsp = new JScrollPane(table);
	String title = "Alle Termine f" + UniCode.getue() + "r : " + matricule+"  [ "+ anzahlEintraege+" Eintr"+UniCode.getae()+"ge ]";
	
	this.setTitle(title);
	this.add(jsp, BorderLayout.CENTER);
	this.pack();
	this.setLocation(150, 400);
	this.setSize(1100, 300);
	this.setVisible(true);
    }
}
